/*
 * file:tguil.c
 * */
/* ------------------------------------------------------------------------- */
#include "tguil.h"

/* ------------------------------------------------------------------------- */
/* obj setting */
void tgui_obj_eventset(ui_object_t * pobj,ui_event_cb_t * puecb,void * pusrdat)
{
    if (!pobj){return;}
    pobj->event_cb = puecb;
    pobj->pudata = pusrdat;
}
void tgui_obj_setitem(ui_object_t * parent,ui_object_t * pitem)
{
    if (!parent){return;}
    if (!pitem){return;}
    if (pitem->pre){return;}

    if(parent->item)
    {
        parent->item->pre = pitem;//old set

        pitem->par  = parent;
        pitem->next = parent->item;//

        parent->item = pitem;
    }
    else
    {
        pitem->par  = parent;
        parent->item = pitem;
    }
}
/* ------------------------------------------------------------------------- */
unsigned  char tgui_obj_check(UI_CTRL_T * puctl)
{

    return 0;
}
/* ------------------------------------------------------------------------- */

void TguilRun(UI_CTRL_T * puctl)
{
    if (puctl->eventid)
    {
        if(tgui_obj_check(puctl))
        {
            puctl->point->signal_cb(puctl->point,puctl->eventid,puctl);
        }
        puctl->eventid = 0;
    }
}

